feat(#175): network response + dump commands for API flow capture#464
Open
giulio-leone wants to merge 4 commits intovercel-labs:mainfrom
Open
feat(#175): network response + dump commands for API flow capture#464giulio-leone wants to merge 4 commits intovercel-labs:mainfrom
giulio-leone wants to merge 4 commits intovercel-labs:mainfrom
Conversation
Contributor
|
@g97iulio1609 is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
6b1453c to
3869b3e
Compare
This was referenced Feb 13, 2026
Add networkdump command with host/type filters, header redaction, idempotent tracking, WeakMap response matching, and monotonic IDs. Refs: vercel-labs#175
72f46f1 to
0c38cfb
Compare
There was a problem hiding this comment.
Pull request overview
Adds network inspection and export capabilities to the agent-browser CLI/protocol so users can capture API flows (requests + responses) during a browsing session, including new “network response” and “network dump” commands and enhanced request filtering/redaction.
Changes:
- Extend request tracking to include monotonically increasing request IDs plus response status/headers, with multi-page listener attachment.
- Add new protocol/types for
networkdumpand extendrequestscommand options (host,type,redact). - Update CLI parsing to support
network responseandnetwork dump, plus newnetwork requestsfilters.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds new command type (NetworkDumpCommand) and extends RequestsCommand options. |
| src/protocol.ts | Adds Zod schema for networkdump and extends requests schema with new filters. |
| src/browser.ts | Implements request IDs, response metadata capture, multi-page tracking, filtering, and redaction in getRequests. |
| src/actions.ts | Wires the new networkdump action into dispatch and implements file export handler. |
| cli/src/commands.rs | Adds CLI subcommands network response and network dump and extends network requests flags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Use Map<number, TrackedRequest> for O(1) response matching instead of find() - Add networkdump and responsebody to ACTION_CATEGORIES under network - Include response headers in responsebody action output
Fixes TS2345: command.filter (string) is not assignable to the options object parameter. Spread all RequestsCommand filter fields properly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #175
New Commands
network response <url> [--timeout <ms>]Wait for and capture a response matching a URL pattern. Returns status code, headers, and parsed body.
network dump --out <path> [--filter <url>] [--host <domain>] [--type <types>] [--redact]Export all tracked requests as structured JSON.
Enhanced
network requestsFilters--host <domain>— Filter by hostname (substring match)--type xhr,fetch— Filter by resource type (comma-separated)--redact— Mask sensitive headers (Authorization, Cookie, Set-Cookie, X-Api-Key, X-Auth-Token)--filter <url>— Existing URL substring filter (unchanged)Implementation Details
TrackedRequestwith auto-increment IDs, status codes, response headersWeakMap-based response matching (Playwright Request identity, not URL)isTrackingRequests)setupPageTrackingExample Usage